<template>
  <div>
    <van-nav-bar
      title="输入原密码"
      left-text="返回"
      left-arrow
      @click-left="$router.replace('/user')"
    />
    <van-form @submit="submit">
      <van-field
        type="password"
        name="密码"
        label="密码"
        placeholder="请输入原密码"
        v-model="pwd"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit">ok</van-button>
      </div>
    </van-form>
  </div>
</template>

<script>
import roofVue from "./other/roof.vue";
export default {
  data() {
    return {
      pwd: "",
    };
  },
  components: {
    roofVue,
  },
  methods: {
    submit() {
      if (this.pwd.length < 6) {
        return this.$notify({
          type: "warning",
          message: "密码长度不能低于六位",
        });
      }
      this.Sto.Session.set("pwd", this.pwd);
      this.$router.push("/fotget");
    },
  },
};
</script>

<style scoped>
</style>